package com.winderinfo.yikaotianxia.ui.videolearning;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;

import com.winderinfo.yikaotianxia.R;
import com.winderinfo.yikaotianxia.core.base.BaseFragment;
import com.winderinfo.yikaotianxia.ui.xiangqin.AboutInstructorBean;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;

public class IntroduceFragment extends BaseFragment {

    @BindView(R.id.int_web)
    WebView intWeb;
    Unbinder unbinder;
    private String details;

    String varjs = "<script type='text/javascript'> \nwindow.onload = function()\n{var $img = document.getElementsByTagName('img');for(var p in  $img){$img[p].style.width = '100%'; $img[p].style.height ='auto'}}</script>";


    @Override
    protected int initLayoutId() {
        return R.layout.fragment_introduce;
    }

    @Override
    protected void initView(View view) {
        details = getArguments().getString("details");
    }

    @Override
    protected void initData() {
        //支持javascript
        intWeb.getSettings().setJavaScriptEnabled(true);
        intWeb.loadDataWithBaseURL("", varjs + details, "text/html", "UTF-8", null);
    }
}
